<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>修改商品</title>
    <link type="text/css" rel="stylesheet" th:href="@{/static/css/style.css}" />
    <link rel="stylesheet" th:href="@{/static/css/register.css}"/>
    <link rel="stylesheet" th:href="@{/static/css/cart.css}" />
    <style type="text/css">
        .login_form {
            height: 420px;
            margin-top: 25px;
        }
    </style>
    <script language="JavaScript" th:src="@{/static/script/regist.js}"></script>

</head>
<body>
<div class="header">
    <div class="w">
        <div class="header-right">
            <div class="gohome">
                <a th:href="@{/Commodity.do?operate=seller}">返回</a>
            </div>
        </div>
    </div>
</div>


<div class="login_banner">
    <div class="register_form">
        <h1>商品原信息</h1>
        <form >
            <input type="hidden" name="operate" value="addCommodity"/>
            <div class="form-item" th:object="${session.Tochangecommodity}" >
                <div>
                    <label>商品名称:</label>
                    <p th:text="*{commodity_name}">书名:活着</p>
                </div>
                <div>
                    <label>商品价格:</label>
                    <p th:text="|￥*{price}|">价格:￥66.6</p>
                </div>
                <div>
                    <label>商品库存:</label>
                    <p th:text="*{inventory}">库存:1000</p>
                </div>
                <div>
                    <label>商品图片:</label>
                    <img style="height:200px;width: 160px"
                            th:src="@{|/static/uploads/*{commodity_IMG}|}" alt="">
                </div>
            </div>
        </form>
    </div>
    <div class="register_form" th:object="${session.Tochangecommodity}" >
        <h1>修改商品</h1>
        <form th:action="@{/Commodity.do}" method="post" enctype="multipart/form-data" >
            <input type="hidden" name="operate" value="updateCommoditytwo"/>
            <div class="form-item">
                <div>
                    <label>商品名称:</label>
                    <input id="user_nameTXT" type="text" th:value="*{commodity_name}"
                           placeholder="请输入商品名称" name="commodity_name"/>
                </div>
            </div>
            <div class="form-item">
                <div>
                    <label>商品价格:</label>
                    <input id="price"  th:value="*{price}"
                           placeholder="商品价格" name="price"/>
                </div>
            </div>
            <div class="form-item">
                <div>
                    <label>商品库存:</label>
                    <input id="inventory"  th:value="*{inventory}"
                           placeholder="请输入商品库存" name="inventory"/>
                </div>
            </div>
            <div class="form-item">
                <div>
                    <label>商品图片：</label>
                    <input type="file" name="part" ></span>
                </div>
            </div>
            <button th:unless="*{state==2}"class="btn">修改</button>
            <button th:if="*{state==2}" class="btn">申请重新上架</button>
        </form>
    </div>
</div>

</body>
</html>
